from selenium.webdriver.common.by import By

iframe_url = By.ID, 'ifcontent'
cotrol_click = By.XPATH, '//*[@id="admin-offcanvas"]/div/ul/li[4]/a'  # 权限控制大菜单//*[@id="admin-offcanvas"]/div/ul/li[5]/a
management_list = By.XPATH, '//*[@id="power-menu-1"]/li[1]/a'  # 管理员列表
# 添加管理员
add_admin = By.XPATH, '/html/body/div[2]/div/form/div[2]/a[1]'  # 添加管理员
input_user = By.XPATH, '/html/body/div[2]/div/form/div[1]/input'  # 输入用户名
input_pwd = By.XPATH, '/html/body/div[2]/div/form/div[2]/input'  # 输入密码
input_num = By.XPATH, '/html/body/div[2]/div/form/div[3]/input'  # 输入手机号码
click_sex_girl = By.XPATH, '/html/body/div[2]/div/form/div[4]/div/label[2]'  # 女性
click_sex_boy = By.XPATH, '/html/body/div[2]/div/form/div[4]/div/label[3]'  # 男性
click_power = By.XPATH, '/html/body/div[2]/div/form/div[5]/div/a/span'  # 权限组
select_power = By.XPATH, '/html/body/div[2]/div/form/div[5]/div/div/ul/li[3]'  # 管理员
select_status = By.XPATH, '/html/body/div[2]/div/form/div[6]/div/div/ul/li[2]'  # 选择状态
click_bc = By.XPATH, '/html/body/div[2]/div/form/div[7]/button'  # 保存按钮
admin_text = By.XPATH, '//*[@id="common-prompt"]/p'  # 获取结果文本
click_cz = By.XPATH, '/html/body/div[2]/div/form/div[2]/a[2]'
# 修改管理员信息
update_admin = By.XPATH, '//tbody/tr[1]/td[11]/a'  # 编辑按钮//*[@id="data-list-4"]/td[11]/a//*[@id="data-list-80"]/td[11]/a
update_pwd = By.XPATH, '/html/body/div[2]/div/form/div[2]/input'  # 修改密码
update_num = By.XPATH, '/html/body/div[2]/div/form/div[2]/input'  # 修改号码
update_sex = By.XPATH, '/html/body/div[2]/div/form/div[4]/div/label[3]'  # 修改性别
update_click_status = By.XPATH, '/html/body/div[2]/div/form/div[6]/div/a/span'  # 状态下拉框
update_status = By.XPATH, '/html/body/div[2]/div/form/div[6]/div/div/ul/li[2]'  # 修改状态
update_click = By.XPATH, '/html/body/div[2]/div/form/div[7]/button'  # 点击保存
click_xg = By.XPATH, '//*[@id="common-prompt"]/p'  # 获取结果文本
# 搜索管理员
search_admin_input = By.XPATH, '/html/body/div[2]/div/form/div[3]/table/thead/tr[2]/td[2]/input'  # 按输入管理员名字搜索
search_admin = By.XPATH, '/html/body/div[2]/div/form/div[2]/button[2]'  # 搜索按钮
# 删除管理员
reset_admin = By.XPATH, '/html/body/div[2]/div/form/div[2]/button[1]'  # 重置
delete_admin = By.XPATH, '//tbody/tr[1]/td[11]/button[2]'  # 删除按钮
delete_queren = By.CSS_SELECTOR, 'div.am-modal-footer > span:nth-child(2)'  # 确定按钮
# 角色管理
role_management = By.XPATH, '//*[@id="power-menu-1"]/li[2]/a/span'  # 角色管理
add_user = By.XPATH, '/html/body/div[2]/div/form/div[2]/a[1]'  # 新增按钮
add_user_name = By.XPATH, '/html/body/div[2]/div/form/div[1]/input'  # 输入用户名
node1 = By.XPATH, '/html/body/div[2]/div/form/div[2]/ul/ul[1]/li[2]/label/input'  # 系统设置权限
node2 = By.XPATH, '/html/body/div[2]/div/form/div[2]/ul/ul[3]/li[5]/label/input'  # 管理员详情
node3 = By.XPATH, '/html/body/div[2]/div/form/div[2]/ul/ul[3]/li[10]/label/input'  # 角色状态更新
node4 = By.XPATH, '/html/body/div[2]/div/form/div[2]/ul/ul[6]/li[15]/label/input'  # 订单售后详情
node5 = By.XPATH, '/html/body/div[2]/div/form/div[3]/div/div/span[1]'  # 是否启用按钮
node_button = By.XPATH, '/html/body/div[2]/div/form/div[4]/button'  # 保存按钮
user_text = By.XPATH, '//*[@id="common-prompt"]/p'  # 获取新增结果文本
# 编辑用户权限
update_user = By.XPATH, '//tbody/tr[1]/td[6]/a'  # 编辑按钮
update_username = By.XPATH, '/html/body/div[2]/div/form/div[1]/input'  # 编辑用户名
update_user_node1 = By.XPATH, '/html/body/div[2]/div/form/div[2]/ul/ul[8]/li[6]/label/input'  # 品牌详情勾选框
update_user_node2 = By.XPATH, '/html/body/div[2]/div/form/div[2]/ul/ul[9]/li[6]/label/input'  # 品牌详情勾选框
update_user_node3 = By.XPATH, '/html/body/div[2]/div/form/div[2]/ul/ul[12]/li[17]/label/input'  # 品牌详情勾选框
update_user_node4 = By.XPATH, '/html/body/div[2]/div/form/div[3]/div'  # 是否启用按钮
update_node_button = By.XPATH, '/html/body/div[2]/div/form/div[4]/button'  # 保存按钮
update_user_text = By.XPATH, '//*[@id="common-prompt"]/p'  # 获取修改结果文本
update_user_select = By.XPATH, '/html/body/div[2]/div/form/div[3]/table/thead/tr[1]/th[1]/button'  # 全选按钮
update_user_select1 = By.XPATH, '/html/body/div[2]/div/form/div[3]/table/thead/tr[1]/th[1]/button'  # 反选按钮
# 搜索用户和删除用户
search_user_input = By.XPATH, '/html/body/div[2]/div/form/div[3]/table/thead/tr[2]/td[2]/input'  # 按照角色名搜索输入框
search_user = By.XPATH, '/html/body/div[2]/div/form/div[2]/button[2]'  # 搜索按钮
user_details = By.XPATH, '//tbody/tr[1]/td[6]/button[1]'  # 详情按钮
user_details_dele = By.XPATH, '/html/body/div[5]'  # 退出详情页//*[@id="am-modal-dfbvy"]/div/span
delete_user = By.XPATH, '//tbody/tr[1]/td[6]/button[2]'  # 删除用户//*[@id="data-list-24"]/td[6]/button[2]
delete_user_qr = By.CSS_SELECTOR, 'div.am-modal-footer > span:nth-child(2)'  # 确定删除按钮
reset_user = By.XPATH, '/html/body/div[2]/div/form/div[2]/a[2]'  # 重置
# 权限分配
# 增加权限
power_list = By.PARTIAL_LINK_TEXT, '权限分配'  # 权限分配
add_power = By.XPATH, '/html/body/div[2]/div/div[2]/button'  # 新增按钮
column_level = By.XPATH, '//*[@id="power-save-win"]/div/div[2]/form/div[1]/div/a/div'  # 栏目级别
column_level_select = By.XPATH, '//*[@id="power-save-win"]/div/div[2]/form/div[1]/div/div/div/input'  # 栏目级别输入
power_name_input = By.XPATH, '//*[@id="power-save-win"]/div/div[2]/form/div[2]/input'  # 权限名称
column_name_input = By.XPATH, '//*[@id="power-save-win"]/div/div[2]/form/div[3]/input'  # 控制器名称
def_name_input = By.XPATH, '//*[@id="power-save-win"]/div/div[2]/form/div[4]/input'  # 方法名称
power_num = By.XPATH, '//*[@id="power-save-win"]/div/div[2]/form/div[6]/input'  # 顺序框
power_add_btn = By.XPATH, '//*[@id="power-save-win"]/div/div[2]/form/div[8]/button'  # 保存按钮
add_power_text = By.XPATH, '//*[@id="common-prompt"]/p'  # 添加结果文本获取
# 修改权限
update_power = By.XPATH, '//*[@id="data-list-1"]/i'  # 权限控制加号按钮
update_power_hover1 = By.XPATH, '/html/body/div[2]/div/ul/ul[3]/li[6]/label'  # 悬停测试
update_power_1 = By.XPATH, '/html/body/div[2]/div/ul/ul[3]/li[6]/div/span[1]'  # 修改按钮
update_power_2 = By.XPATH, '//*[@id="power-save-win"]/div/div[2]/form/div[6]/input'  # 顺序
update_power_3 = By.XPATH, '//*[@id="power-save-win"]/div/div[2]/form/div[7]/div/label[1]'  # 是否显示中不显示按钮
update_power_text = By.XPATH, '//*[@id="common-prompt"]/p'  # 修改结果文本获取
# 删除权限
delete_power_btn = By.XPATH, '//*[@id="data-list-1"]/i'  # 加号按钮
delete_power_hover = By.XPATH, '/html/body/div[2]/div/ul/ul[3]/li[6]/label'  # 悬停测试
power_delete_btn = By.XPATH, '/html/body/div[2]/div/ul/ul[3]/li[6]/div/span[2]'  # 删除按钮
power_btn = By.CSS_SELECTOR, 'div.am-modal-footer > span:nth-child(2)'  # 确定删除按钮
# 用户管理
user_management = By.PARTIAL_LINK_TEXT, '用户管理'  # 用户管理大菜单
user_management_list = By.PARTIAL_LINK_TEXT, '用户列表'  # 用户列表
# 添加用户
add_mana_user = By.XPATH, '/html/body/div[2]/div/form/div[2]/a[1]'  # 新增按钮
mana_username = By.XPATH, '/html/body/div[2]/div/form/div[1]/input'  # 用户名
mana_username1 = By.XPATH, '/html/body/div[2]/div/form/div[2]/input'  # 昵称
mana_phone = By.XPATH, '/html/body/div[2]/div/form/div[3]/input'  # 手机号码
mana_email = By.XPATH, '/html/body/div[2]/div/form/div[4]/input'  # 电子邮箱
mana_openid = By.XPATH, '/html/body/div[2]/div/form/div[8]/input'  # qqopenid
mana_birthday = By.XPATH, '/html/body/div[2]/div/form/div[13]/input'  # 生日
# mana_birthday1 = By.XPATH, '//*[@id="dpTitle"]/div[1]/a'  # 换年
# mana_birthday2 = By.XPATH, '//*[@id="dpTitle"]/div[6]/a'  # 换月
# mana_birthday3 = By.XPATH, '/html/body/div/div[3]/table/tbody/tr[5]/td[4]'  # 日
mana_address = By.XPATH, '/html/body/div[2]/div/form/div[14]/input'  # 详细地址
mana_sex = By.XPATH, '/html/body/div[2]/div/form/div[15]/div/label[2]'  # 性别（女）
mana_integral = By.XPATH, '/html/body/div[2]/div/form/div[16]/input'  # 积分
mana_userid = By.XPATH, '/html/body/div[2]/div/form/div[18]/input'  # 邀请用户id
mana_pwd = By.XPATH, '/html/body/div[2]/div/form/div[19]/input'  # 登录密码
mana_btn = By.XPATH, '/html/body/div[2]/div/form/div[20]/button'  # 保存按钮/html/body/div[2]/div/form/div[20]/button
mana_scroll = By.XPATH, '/html/body/div[2]/div/form/div[10]/input'
mana_text = By.XPATH, '//*[@id="common-prompt"]/p'  # 修改结果文本获取
# 修改用户信息
update_mana_btn = By.XPATH, '//tbody/tr[1]/td[18]/a'  # 修改按钮
update_mana_username = By.XPATH, '/html/body/div[2]/div/form/div[1]/input'  # 修改用户名17340972561
update_mana_address = By.XPATH, '/html/body/div[2]/div/form/div[14]/input'  # 修改地址
update_mana_sex = By.XPATH, '/html/body/div[2]/div/form/div[15]/div/label[3]'  # 修改性别
update_mana_stauts = By.XPATH, '/html/body/div[2]/div/form/div[17]/div'  # 用户状态
update_status_input = By.XPATH, '/html/body/div[2]/div/form/div[17]/div/div/div/input'  # 状态输入框
update_mana_text = By.XPATH, '//*[@id="common-prompt"]/p'  # 修改结果文本获取
# 搜索用户
search_mana_name = By.XPATH, '/html/body/div[2]/div/form/div[3]/table/thead/tr[2]/td[4]/input'  # 输入用户名
search_mana = By.XPATH, '/html/body/div[2]/div/form/div[2]/button[2]'  # 搜索按钮
search_mana_egs = By.XPATH, '//tbody/tr[1]/td[18]/button[1]'  # 详情按钮
# 删除用户
delete_mana = By.XPATH, '//tbody/tr[1]/td[18]/button[2]'  # 删除按钮
delete_mana_btn = By.CSS_SELECTOR, 'div.am-modal-footer > span:nth-child(2)'  # 确定按钮

# 商品管理大菜单
commodity_managements = By.PARTIAL_LINK_TEXT, '商品管理'
commodity_management = By.XPATH, '//*[@id="power-menu-38"]/li[1]/a'  # 商品管理
add_commodity = By.XPATH, '/html/body/div[2]/div/form/div[2]/a[1]'  # 添加商品
user_name = By.XPATH, '/html/body/div[2]/div/form/div[1]/input'  # 用户名
user_name1 = By.XPATH, '/html/body/div[2]/div/form/div[2]/input'  # 昵称
user_number = By.XPATH, '/html/body/div[2]/div/form/div[3]/input'  # 手机号码
commodity_user_birthday = By.XPATH, '/html/body/div[2]/div/form/div[13]/input'  # 生日
commodity_user_address = By.XPATH, '/html/body/div[2]/div/form/div[14]/input'  # 地址
commodity_user_pwd = By.XPATH, '/html/body/div[2]/div/form/div[19]/input'  # 密码

# commodity_group = By.XPATH, '//*[@id="power-menu-38"]/li[2]/a'  # 商品分类
# commodity_comment = By.XPATH, '//*[@id="power-menu-38"]/li[3]/a'  # 商品评论
# commodity_browse = By.XPATH, '//*[@id="power-menu-38"]/li[4]/a'  # 商品浏览
# commodity_collect = By.XPATH, '//*[@id="power-menu-38"]/li[5]/a'  # 商品收藏
